package com.cfun.mylearn.Support.api;


import com.cfun.mylearn.Support.module.APISession;

import java.util.List;

import retrofit2.http.GET;
import retrofit2.http.Query;
import rx.Observable;

/**
 * Created by flyop on 19/06/2016.
 */
public interface ZheDailyApiService
{

    /*
    params.setParams("device_id", "");
		params.setParams("account_id", "");
		params.setParams("session_id", "");

		params.setParams("device_type", Build.MODEL);
		params.setParams("os_type", "Android " + Build.VERSION.RELEASE);
		String device_uuid = ResourceReader.getUuid();
		// String device_uuid = ResourceReader.readUuid();
		params.setParams("device_uuid", device_uuid);

        params.setTimestamp(timestamp);
        params.setSignature(timestamp);
        params.setSignatureMethod();
    * */
    @GET("api/session/create2")
    Observable<List<APISession>> creatSession(
            @Query("device_id") String device_id,
            @Query("account_id") String account_id,
            @Query("session_id") String session_id,
            @Query("device_type") String device_type,
            @Query("os_type") String os_type,
            @Query("device_uuid") String device_uuid,
            @Query("app_id") String app_id,
            @Query("timestamp") String timestamp,
            @Query("signature") String signature,
            @Query("signature_method") String signature_method);


//    @GET
//    abstract Observable<List<Repo>> creatSession(@Path("user") String user);
//    {
//        String str = "api/session/create2" + creatParaStr("device_id", "account_id", "session_id", "device_type", "os_type", "device_uuid");
//    }
//
//    public static final String creatParaStr(String uri, String... paras)
//    {
//        StringBuilder sb = new StringBuilder(uri).append("?");
//        for (String arg : paras)
//        {
//            if (!TextUtils.isEmpty(arg))
//                sb.append(arg).append("={").append(arg).append("}&");
//        }
//        return sb.substring(0, sb.length() - 1);
//    }
}
